<?php
//点赞
if(isset($_GET['id'])){
	include('./include/conn.php');
	$query="SELECT * FROM msg WHERE id='".$_GET['id']."'";
	$rs = $link->query($query);
    if($rs->num_rows){
    	//where 条件 具体更新哪一条记录 islike字段
    	$query = "UPDATE msg SET islike=islike+ 1 WHERE id='".$_GET['id']."'";
    	$rs = $link->query($query);
    	if($rs){
    		echo "<script>alert('点赞成功！'); window.history.go(-1);</script>";
    	}else{
    		echo "<script>alert('点赞无效，请重新操作！'); window.history.go(-1);</script>";
    	}
    }else{
    	echo "<script>alert('点赞无效，请重新操作！'); window.history.go(-1);</script>";
    }
}
?>